import http from "../utils/request";

export default {
  //最近查看
  getRecentView(userid) {
    return http.get(`tags/getRecentView?userId=${userid}`);
  },
  // 精准推送
  getInterest(username, search, pageNo, pageSize) {
    let url = `interest/getPushList?username=${username}&tag=${search}&pageNo=${pageNo}&pageSize=${pageSize}`;
    return http.get(url);
  },
  // 信息排行
  selectHotInfo() {
    return http.get("tags/selectHotInfo");
  },

  // 推送历史详情
  getHistoryById(id, userid) {
    return http.get(`JDT/gethistory?id=${id}&username=${userid}`);
  },

  // 增加重大事件
  addEvent(params) {
    return http.post(`ZDSJ/insertZdsj`, params);
  },

  // 事件列表
  getEventList(page,pageSize) {
    return http.get(`ZDSJ/selectZdsj?page=${page}&pageSize=${pageSize}`);
  },

  // 修改重大事件
  updateEvent(params) {
    return http.post(`ZDSJ/updateZdsj`, params);
  },

  // 删除重大事件
  delEvent(id) {
    return http.get(`ZDSJ/deleteZdsj?id=${id}`);
  },

  // 推送详情
  getImgLabelById(id, userid) {
    return http.get(`tags/getImgLabelById?id=${id}&userId=${userid}`);
  },

  // 评分配置
  queryweight(id) {
    return http.get(`user/queryweight/${id}`);
  },
  //更改评分配置
  weightAllot(params) {
    return http.post(`user/weightAllot`, params);
  },

  // 添加不喜欢
  addDislike(tags) {
    return http.post(`interest/addDislike`, tags);
  },
  // 查询忽略标签
  selectDislike(userid) {
    return http.get(`interest/selectDislike?userid=${userid}`);
  },
  // 删除忽略标签
  deleteDislike(id) {
    return http.get(`interest/deleteDislike?id=${id}`);
  },
};
